package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.bean.BindExchangeBean;
import com.lianzhihui.romeex.bean.ExchangeFindExchangeFlowBean;
import com.lianzhihui.romeex.bean.ExchangeFindHomeBean;
import com.lianzhihui.romeex.bean.FindExchangeInfoBean;
import com.lianzhihui.romeex.bean.ProfitFindHomeBean;
import com.lianzhihui.romeex.mvp.model.ExchangeRecordModelImp;
import com.lianzhihui.romeex.mvp.model.ExchangeRecordModelInterface;
import com.lianzhihui.romeex.mvp.model.HuaZhuanModelImp;
import com.lianzhihui.romeex.mvp.model.HuaZhuanModelInterface;
import com.lianzhihui.romeex.mvp.view.FragmentExchangeView;
import com.lianzhihui.romeex.mvp.view.HuaZhuanActivityView;

import io.reactivex.disposables.Disposable;

//逻辑实现
public class ExchangeRecordPresnterImp implements ExchangeRecordModelInterface {

    private final FragmentExchangeView viewLayer;
    private final ExchangeRecordModelImp modelImp;

    public ExchangeRecordPresnterImp(Context context, FragmentExchangeView viewLayer) {
        this.viewLayer = viewLayer;
        modelImp = new ExchangeRecordModelImp(context, this);
    }


    public Disposable requestExchangeFindExchangeFlow(String page, String pageSize, String type) {
       return modelImp.requestExchangeFindExchangeFlow(page, pageSize, type);
    }

    @Override
    public void responseSuccess(ExchangeFindExchangeFlowBean bean) {
        viewLayer.responseFindHomeSuccess(bean);
    }


    @Override
    public void onFailure() {
        viewLayer.setFailure();
    }
}
